<template>
  <el-config-provider :size="state.size">
    <router-view v-if="state.showRouter" />
  </el-config-provider>
</template>
<script>
export default {
  name: 'App',
}
</script>
<script setup>
import Cookies from 'js-cookie'
import { provide, reactive, nextTick } from 'vue'

const state = reactive({
  showRouter: true,
  size: Cookies.get('size') || ''
})

const reload = () => {
  state.size = Cookies.get('size')
  state.showRouter = false
  nextTick(() => {
    state.showRouter = true
  })
}
provide('reload', reload)

</script>
